﻿Public Class Dipendente
  Private Matr As Integer
  Private Cognome As String
  Private Nome As String
  Public Sub New(ByVal pMatricola As Integer, _
          ByVal pNome As String, _
          ByVal pCognome As String)
    scriviMatricola( _
        CType(pMatricola, String))
    scriviCognome(pCognome)
    scriviNome(pNome)
  End Sub
  Private Sub scriviMatricola(ByVal _
           pMatricola As String)
    Matr = CType(pMatricola, Integer)
  End Sub
  Public Sub scriviCognome(ByVal _
           pCognome As String)
    Cognome = pCognome
  End Sub
  Public Sub scriviNome(ByVal pNome As String)
    Nome = pNome
  End Sub
  Public Function leggiMatricola() As String
    Return CType(Matr, String)
  End Function
  Public Function leggiNominativo() As String
    Return Cognome & " " & Nome
  End Function
End Class
